function send(url, method, data) {
    return fetch(
        url, {
            method: method,
            headers: {
                'Accept': 'application/json'
            },
            body: data
        }
    ).then(resp => resp.json())
}

function get(url) {
    return send(url, 'get')
}

function post(url, data) {
    return send(url, 'post', data)
}
